using System;
using System.Data;
using System.Linq;
using System.ComponentModel;
using System.Reflection;
using System.Collections.Generic;
using VSSAHT.Transfer;
using VSS_AHT.DataAccess;
using VSSAHT.DataAccess;
namespace VSSAHT.Database
{
	public partial class ModelVehicleMapper
	{
		#region ToEntity

		public static ModelVehicle ToEntity(ModelVehicle entity, ModelVehicleDTO businessobject)
		{
			if (businessobject == null)
			{
				return null;
			}
			entity.ModelVehicleID = businessobject.ModelVehicleID;
			entity.ModelVehicleNumber = businessobject.ModelVehicleNumber;
			entity.ModelVehicleWeight = businessobject.ModelVehicleWeight;
			entity.RowVersion = VersionConverter.ToBinary(businessobject.RowVersion);
			return entity;
		}

		#endregion

		#region ToBusinessObject

		public static ModelVehicleDTO ToBusinessObject(ModelVehicle entity)
		{
			if (entity == null)
			{
				return null;
			}
			return new ModelVehicleDTO
			{
				ModelVehicleID = entity.ModelVehicleID,
				ModelVehicleNumber = entity.ModelVehicleNumber,
				ModelVehicleWeight = entity.ModelVehicleWeight,
				RowVersion = VersionConverter.ToString(entity.RowVersion)
			};
		}

		#endregion

		#region ToBusinessObjectHasChildren

		public static ModelVehicleDTO ToBusinessObjectHasChildren(ModelVehicle entity, params Type[] types)
		{
			if (entity == null)
			{
				return null;
			}
			ModelVehicleDTO businessobject = new ModelVehicleDTO
			{
				ModelVehicleID = entity.ModelVehicleID,
				ModelVehicleNumber = entity.ModelVehicleNumber,
				ModelVehicleWeight = entity.ModelVehicleWeight,
				RowVersion = VersionConverter.ToString(entity.RowVersion)
			};
			return businessobject;
		}

		#endregion

	}
}
